<template>
	<view>
		<navbar title="订单"></navbar>
		<u-sticky bgColor="#F8F8F8" customNavHeight="103rpx" :offsetTop="$u.addUnit($u.sys().statusBarHeight,'px')">
			<scroll-view scroll-x="true" style="width: 750rpx;">
				<view class="tab u-flex-y-center">
					<view class="tab__item" v-for="(item,index) in tab" :key="index" @click="curtab=index"
						:class="curtab==index?'active':''">
						{{item.name}}
					</view>
				</view>
			</scroll-view>
		</u-sticky>
		<view class="list">
			<view class="list__item" v-for="(item,index) in 10" :key="index">
				<view class="u-flex" style="margin-bottom: 25rpx;">
					<image src="/static/logo.png" class="list__item__pic" mode="aspectFill"></image>
					<view class=""  style="flex: 1;">
						<view class="u-flex u-flex-y-center u-flex-between">
							<view class="list__item__name">
								家用充电桩安装
							</view>
							<view class="list__item__status" v-if="curtab==5">
								已完成
							</view>
							<view class="list__item__status status2" v-if="curtab==2">
								待接单
							</view>
						</view>
						<view class="list__item__time">
							期望上门时间: 07月25日(周五)22:00~24:00
						</view>
						<view class="list__item__gg">
							规格名称: 默认数量 × 1
						</view>
						
						<!-- <view class="list__item__addr">
							服务地址: 山西省太原市小店区13131318
						</view> -->
						<view class="list__item__price">
							180.0
						</view>
					</view>
				</view>
				<view class="u-flex u-flex-y-center u-flex-end">
					<view class="list__item__btn1">
						取消订单
					</view>
					<view class="list__item__btn2">
						修改预约
					</view>
				</view>
			</view>
		</view>
	</view>
	<!-- <tabbar :current="2"></tabbar> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list1: ['/static/homed/banner.png'],
				tab: [{
						name: '全部',
						status: ''
					},
					{
						name: '待付款',
						status: ''
					},
					{
						name: '待接单',
						status: ''
					},
					{
						name: '已接单',
						status: ''
					},
					{
						name: '服务中',
						status: ''
					},
					{
						name: '已完成',
						status: ''
					},

				],
				curtab: 0
			};
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #F8F8F8;
	}
	.tab {
		padding: 0 0 25rpx 6rpx;

		&__item {
			width: 123rpx;
			height: 48rpx;
			background: #FFFFFF;
			border-radius: 24rpx 24rpx 24rpx 24rpx;
			border: 3rpx solid #fff;
			display: flex;
			align-items: center;
			justify-content: center;
			font-weight: 500;
			font-size: 24rpx;
			color: #55585A;
			line-height: 24rpx;
			margin-left: 18rpx;
			flex-shrink: 0;
		}

		.active {
			background: #EEFFEE;
			color: #0AA85B;
			font-weight: 800;
			border-color: #0AA85B;
		}
	}

	.list {
		padding: 0 30rpx 30rpx;

		&__item {
			margin-bottom: 20rpx;
			padding: 26rpx;
			background: #FFFFFF;
			border-radius: 20rpx 20rpx 20rpx 20rpx;

			&__pic {
				width: 168rpx;
				height: 168rpx;
				border-radius: 20rpx 20rpx 20rpx 20rpx;
				margin-right: 20rpx;
			}

			&__name {
				font-family: PingFang-SC, PingFang-SC;
				font-weight: 800;
				font-size: 30rpx;
				color: #2A2C2C;
				line-height: 50rpx;
			}

			&__status {
				font-family: PingFang-SC, PingFang-SC;
				font-weight: 500;
				font-size: 24rpx;
				color: #727272;
				line-height: 24rpx;
			}

			&__gg {
				font-family: PingFang-SC, PingFang-SC;
				font-weight: 500;
				font-size: 22rpx;
				color: #727272;
				line-height: 36rpx;
			}

			&__time {
				font-family: PingFang-SC, PingFang-SC;
				font-weight: 500;
				font-size: 22rpx;
				color: #727272;
				line-height: 42rpx;
			}

			&__addr {
				font-family: PingFang-SC, PingFang-SC;
				font-weight: 500;
				font-size: 22rpx;
				color: #727272;
				line-height: 42rpx;
			}
			&__price{
				font-family: DINNextLTPro, DINNextLTPro;
				font-weight: 500;
				font-size: 38rpx;
				color: #FD3C33;
				line-height: 42rpx	;
				&::before{
					content: "￥";
					font-size: 24.91rpx;
				}
			}
			&__btn1 {
				width: 147rpx;
				height: 58rpx;
				background: #fff;
				border-radius: 29rpx 29rpx 29rpx 29rpx;
				border: 2rpx solid #F5F5F5;
				display: flex;
				align-items: center;
				justify-content: center;
				font-family: PingFang-SC, PingFang-SC;
				font-weight: 500;
				font-size: 25rpx;
				color: #585858;
				line-height: 25rpx;

			}

			&__btn2 {
				width: 147rpx;
				height: 58rpx;
				background: #2EB16C;
				border-radius: 29rpx 29rpx 29rpx 29rpx;
				font-family: PingFang-SC, PingFang-SC;
				font-weight: 500;
				font-size: 25rpx;
				color: #FFFFFF;
				line-height: 25rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				margin-left: 18rpx;
			}
		}
	}
	.status2{
		color: #2EB16C;
	}
</style>